PUT softwares/
{
  "mappings": {
    "_meta": {
      "software_version_mapping": "1.0"
    }
  }
}

GET softwares/_mapping

PUT softwares/_doc/1
{
  "software_version":"7.1.0"
}

DELETE softwares

// 优化,使用inner object
PUT softwares/
{
    "mappings": {
        "_meta": {
            "software_version_mapping": "1.1"
        },
        "properties": {
            "version": {
                "properties": {
                    "display_name": {
                        "type": "keyword"
                    },
                    "hot_fix": {
                        "type": "byte"
                    },
                    "marjor": {
                        "type": "byte"
                    },
                    "minor": {
                        "type": "byte"
                    }
                }
            }
        }
    }
}

// 写入文档

PUT softwares/_doc/1
{
    "version": {
        "display_name": "7.1.0",
        "marjor": 7,
        "minor": 1,
        "hot_fix": 0
    }
}

PUT softwares/_doc/2
{
    "version": {
        "display_name": "7.2.0",
        "marjor": 7,
        "minor": 2,
        "hot_fix": 0
    }
}

PUT softwares/_doc/3
{
    "version": {
        "display_name": "7.2.1",
        "marjor": 7,
        "minor": 2,
        "hot_fix": 1
    }
}

GET softwares/_search
{
    "query": {
        "bool": {
            "filter": [
                {
                    "match": {
                        "version.marjor": 7
                    }
                },
                {
                    "match": {
                        "version.minor": 2
                    }
                }
            ]
        }
    }
}